<extend name="Public/base" />

<block name="body">
	<div class="main-title cf">
		<h2><if condition="ACTION_NAME eq 'addaction'">新增<else/>编辑</if>行为</h2>
	</div>
	<div class="panel panel-default">
		<div class="panel-heading">
			<if condition="ACTION_NAME eq 'addaction'">新增<else/>编辑</if>
		</div>
		<div class="panel-body">
			<div class="row">
				<div class="col-lg-6">	
	<!-- 表单 -->
	<form id="form" action="{:U('saveAction')}" method="post"   class="form" role="form" >
        <div class="form-group">
			<label class="item-label">行为标识<span class="check-tips">（输入行为标识 英文字母）</span></label> 
			<input type="text" class="form-control" name="name" value="{$data.name}">
 
		</div>
        <div class="form-group">
			<label class="item-label">行为名称<span class="check-tips">（输入行为名称）</span></label> 
			<input type="text" class="form-control" name="title" value="{$data.title}">
 
		</div>
        <div class="form-group">
			<label class="item-label">行为类型<span class="check-tips">（选择行为类型）</span></label>
 
			<select name="type" class="form-control">
				<volist name=":get_action_type(null,true)" id="vo">
					<option value="{$key}">{$vo}</option>
				</volist>
			</select>
 
		</div>
        <div class="form-group">
			<label class="item-label">行为描述<span class="check-tips">（输入行为描述）</span></label>
			<textarea class="form-control" rows="3" name="remark">{$data.remark}</textarea>    
		</div>
        <div class="form-group">
			<label class="item-label">行为规则<span class="check-tips">（输入行为规则，不写则只记录日志）</span></label>
			<textarea class="form-control" rows="3"  name="rule">{$data.rule}</textarea> 
		</div>
        <div class="form-group">
			<label class="item-label">日志规则<span class="check-tips">（记录日志备注时按此规则来生成，支持[变量|函数]。目前变量有：user,time,model,record,data）</span></label>
			<textarea class="form-control" rows="3"  name="log">{$data.log}</textarea>
 		</div>

        <div class="form-group">
			<input type="hidden" name="id" value="{$data.id}"/>
			<button type="submit" class="btn btn-default submit-btn ajax-post" target-form="form">确 定</button>
			<button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</form>
				</div>
				<!-- /.col-lg-6 (nested) -->
			</div>
			<!-- /.row (nested) -->
		</div>
		<!-- /.panel-body -->
	</div>
	<!-- /.panel -->
</block>

<block name="script">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" charset="utf-8">
	Think.setValue('type',{$type|default=1});
    //导航高亮
    highlight_subnav('{:U('User/action')}');
</script>
</block>
